# 1、给定一个列表： [465,8231,8123485,215,612318,12534,561231561,5631,584,2318564,584,5634,561326,4156,1]
# 1.1.取出第六个的值
# list1 = [465,8231,8123485,215,612318,12534,561231561,5631,584,2318564,584,5634,561326,4156,1]
# print(list1[5])
#
# # 1.2.判断，如果列表中的值是561231561，则输出：今天你猜对了哦~~~~
# for i in range(len(list1)):
#     if list1[i] == 561231561:
#         print("今天你猜对了哦~~~~")
#
# # 1.3.取出这个列表里面所有的偶数，创建空列表，使用append方法，添加到新的列表里
# list2 = []
# for i in range(len(list1)):
#     if list1[i] %2== 0 :
#         list2.append(list1[i])
# print(list2)
#
# #2定义集合，使用for遍历访问元素
# set1 = {1,4,7,2,5,8}
# for i in set1:
#     print(i)
#
# # 3定义字符串，使用for遍历访问元素
# string1 = "abcdefg"
# for string2 in string1:
#     print(string2)
#
# # 4定义字典，使用for遍历访问元素
# dic1 = {'name':'1','ages':'2','sex':'3','lwx':'4','wwk':'5','uzi':'6'}
# for key,value in dic1.items():
#     print(key,value)
#
# # 5定义列表，使用for遍历访问元素
# list3 = ['a', 'b', 'c']
# for n in range(len(list3)):
#     list4 = list3[n]
#     print(list4)
#
# # 6遍历：{465,84564,5641,21564,1891563,481564,651,"刘闯","王李","李四","王三"}
# set2 = {465,84564,5641,21564,1891563,481564,651,"刘闯","王李","李四","王三"}
# print(set2)
# for n in set2:
#     if n== "刘闯":
#         break
#     print(n)




# 给一个列表：[123,456,789,15231,596489,123,456,12389,123]
# 取出偶数位的数，并加到一个新的列表里面
list1 = [123,456,789,15231,596489,123,456,12389,123]
list2  = []
for i in range(len(list1)):
    if i%2 == 1:
        list2.append(list1[i])
print(list2)

